﻿using Cassandra.Data.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Cognitum.CassandraTableStorage.Entities
{
    [AllowFiltering]
    [Table]
    public class user_entity : TableServiceEntity
    {
        #region | Constructors  |

        public user_entity(string partitionKey)
            : base(partitionKey)
        { }

        public user_entity()
            : this(Guid.NewGuid().ToString())
        { }

        #endregion | Constructors  |

        #region | Membership provider properties |

        [ClusteringKey(1),
        Column]
        public string application_name { get; set; }

        [ClusteringKey(2),
       Column]
        public String username { get; set; }

        [Column]
        public String password { get; set; }

        [Column]
        [SecondaryIndex]
        public String email { get; set; }

        [Column]
        public String password_question { get; set; }

        [Column]
        public String password_answer { get; set; }

        [Column]
        public bool is_approved { get; set; }

        [Column]
        public String comment { get; set; }

        [Column]
        public DateTimeOffset creation_date { get; set; }

        [Column]
        public DateTimeOffset last_login_date { get; set; }

        [Column]
        public DateTimeOffset last_password_changed_date { get; set; }

        [Column]
        [SecondaryIndex]
        public DateTimeOffset last_activity_date { get; set; }

        [Column]
        public bool is_locked_out { get; set; }

        [Column]
        public DateTimeOffset last_locked_out_date { get; set; }

        [Column]
        public int failed_password_attempt_count { get; set; }

        [Column]
        public DateTimeOffset failed_password_attempt_window_start { get; set; }

        [Column]
        public int failed_password_answer_attempt_count { get; set; }

        [Column]
        public DateTimeOffset failed_password_answer_attempt_window_start { get; set; }

        [Column]
        [SecondaryIndex]
        public bool is_deleted { get; set; }

        #endregion | Membership provider properties |

        #region | Profile provider properties |

        [Column]
        [SecondaryIndex]
        public bool is_profile_deleted { get; set; }

        [Column]
        public int gender { get; set; }

        [Column]
        public DateTimeOffset last_profile_updated_date { get; set; }

        [Column]
        public DateTimeOffset birthday { get; set; }

        [Column]
        public string portrait_blob_address_uri { get; set; }

        #endregion | Profile provider properties |
    }
}